package info.techgeek.labs.hashset;

import java.util.HashSet;

public class HashCode {
	
	private String s;

	public HashCode(String s) {
		this.s = s;
	}

	
	public static void main(String[] args) {
	
		HashSet<Object> hs = new HashSet<Object>();
		HashCode ws1 = new HashCode("ac");
		HashCode ws2 = new HashCode("bd");
		
		 hs.add(ws1); 
		 hs.add(ws2);
		 
		 System.out.println("ws1"+ws1);
		 System.out.println("ws2"+ws2);
		 
		 System.out.println(hs.size());
		 
		 System.out.println(hs);
	}
	
	public int hashCode(){
		System.out.println("inside HashCode");
		return  1;
	}
	
	public boolean equals( Object o){
		System.out.println("inside equals");
		if(o instanceof HashCode  && ((HashCode)o).s.equals(this.s) ){
			return true;
		}
		return false;
	}
}
